import { createCommonPage, COLUMN_WIDTH } from '@/utils/service.js'
import { dateFormat } from '@/utils/date'

export const createForm = () => ({
  ...createCommonPage(),
})

export const createColumns = (vm) => [
  {
    title: '序号',
    key: 'id',
    align: 'center',
    width: 80,
    render(h, params) {
      return <div>{(vm.formData.pageNo - 1) * vm.formData.pageSize + params.index + 1}</div>
    },
  },
  {
    title: '稿件标题',
    align: 'center',
    width: COLUMN_WIDTH + 500,
    render(h, params) {
      return <article-title info={params.row}></article-title>
    },
  },
  { title: '采用媒体', key: 'siteName', align: 'center' },
  {
    title: '采用时间',
    align: 'center',
    render(h, params) {
      return <div>{dateFormat(params.row.adoptedTime || '', 'YYYY.MM.DD HH:mm:ss')}</div>
    },
  },
] 
